using huqiang.Core.HGUI;
using System;
using UnityEngine;
using huqiang.UIComposite;
using huqiang.UIEvent;
using huqiang;
using huqiang.Data;
using huqiang.UIModel;

public class PalettePage:UIPage
{
    //反射UI界面上的物体
    class View
    {
        public UIPalette palette;
        public HImage image;
    }
    View view;
    public override void Initial(UIElement parent, object dat = null)
    {
        base.Initial(parent, dat);
        view = LoadUI<View>("baseUI", "PalettePage");//"baseUI"创建的bytes文件名,"page"为创建的页面名
        InitialEvent();
    }
    void InitialEvent()
    {
        view.palette.TemplateChanged = view.palette.ColorChanged = (o) => {
            view.image.MainColor = o.SelectColor;
        };
    }
}
